package com.example.repository;

import com.example.bean.UserInfo;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface UserInfoRepository extends JpaRepository<UserInfo, Integer> {
    UserInfo findUserInfoById(int id);

    List<UserInfo> findUserInfoByRole(String role);

    @Query(value = "select * from t_user limit ?1", nativeQuery =true)
    List<UserInfo> findAllUsersByCount(int count);
}
